function updateDisplay(obj,node)

% This file is part of CISNE.
%
%     CISNE is free software: you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation, either version 3 of the License, or
%     any later version.
%
%     CISNE is distributed in the hope that it will be useful,
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%     GNU General Public License for more details.
%
%     You should have received a copy of the GNU General Public License
%     along with CISNE.  If not, see <http://www.gnu.org/licenses/>.

% Copyright 2011. Jose Maria Garcia-Valdecasas Bernal


grid=node.getValue();
grid=char(grid(2));

handles=guidata(obj.m_figure);

if handles.DisplayWidget.isCGrid(grid)
x0=obj.getValue('X0',grid);
y0=obj.getValue('Y0',grid);
lx=obj.getValue('X Length',grid);
ly=obj.getValue('Y Length',grid);
th=obj.getValue('Angle',grid);

x1=x0-ly*sind(th);
y1=y0+ly*cosd(th);
x2=x1+lx*cosd(th);
y2=y1+lx*sind(th);
x3=x0+lx*cosd(th);
y3=y0+lx*sind(th);

X=[x0 x1 x2 x3 x0];
Y=[y0 y1 y2 y3 y0];

handles.DisplayWidget.drawCGrid(grid,X,Y)

elseif handles.DisplayWidget.isCPoint(grid)
    x=obj.getValue('X',grid);
    y=obj.getValue('Y',grid);
    handles.DisplayWidget.drawCPoint(grid,x,y)
end